package org.wzq.base;

import android.app.Application;
import org.wzq.utils.GeneralUtils;
import org.wzq.utils.Logger;
import org.wzq.utils.SpTool;

/**
 * project:
 * author: wzq
 * date: 2014/8/8
 * description:
 */
public class BaseApplication extends Application {
    private static Application mApplication;

    public static Application getInstance() {
        return mApplication;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        mApplication = this;
        initAtStartup();
    }

    private void initAtStartup() {
        SpTool.injectContext(mApplication);
        GeneralUtils.injectContext(mApplication);

        AppInfo.init();
        DeviceInfo.init();
        //TODO
        Logger logger = Logger.newLogger(true, this);
        logger.v(DeviceInfo.getInfo());
        logger.v(AppInfo.getInfo());
    }
}
